
package com.dg.gaming.client.fx.gui;

import com.dg.gaming.client.fx.gui.ChatUsers;
import com.dg.gaming.client.fx.gui.ControlPanel;
import com.dg.gaming.client.fx.gui.FXMain;
import javafx.scene.CustomNode;
import javafx.scene.paint.Color;
import javafx.scene.text.Font;
import javafx.scene.text.Text;
import org.jfxtras.scene.layout.MigLayout;
import org.jfxtras.scene.layout.MigNode;






/**
 * @author dito
 */

public class FXMainGamePanel extends MigLayout{
    public var mainframe:FXMain;
    var cahtUsers=ChatUsers{mainframe:mainframe};
    var controlPanel=ControlPanel{};
    var gameBoard=GameBoard{};

    init{
       this.fitParent= true;
        this.layout= "fill";
        migContent=[
           MigNode.migNode( controlPanel,   "north" ),
           MigNode.migNode( cahtUsers,   "east" )
          // MigNode.migNode( gameBoard,   "center, grow" )
        ];
    }



 public function setGamePanel(panel:CustomNode){
     migContent=[];
      migContent=[
           MigNode.migNode( controlPanel,   "north" ),
           MigNode.migNode( cahtUsers,   "east" )
           MigNode.migNode( panel,   "center, grow" )
        ];
 }


function createLabel( color:Color, label:String ) {

Text {
          content: label
          font: Font { size: 18 }
        }

  }

  public function setUp(mainframe:FXMain){
         this.mainframe=mainframe;
         controlPanel.setUp(mainframe);
         cahtUsers.setUp(mainframe);
     }

}
